package com.xiaohudie.JVM;

/**
 * @Author xiao hu die
 * @Date 2022/3/21 0:24
 * @Version 1.0
 */
public class TestIntert {
    public static void main(String[] args) {
        String s =new String("a")+new String("b");
        /**将字符串放入常量池中
         * 返回值一直是字符串常量池中的对象*/
        String intern = s.intern();
        if (intern=="ab"){
            System.out.println("放入常量池成功");
        }

    }
}
